import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import ElementUI from 'element-ui';

import 'element-ui/lib/theme-chalk/index.css';
import './common/css/main.scss';
import './common/css/default.scss';

import axios from '@/common/js/request';
import common from '@/common/js/commonMethods';
import uploadProgress from "@/components/UploadProgress/index";

Vue.prototype.$axios = axios;
Vue.prototype.$common = common;

Vue.config.productionTip = false;

Vue.use(ElementUI);
Vue.use(uploadProgress);

var _Vue = new Vue({
    router,
    store,
    render: h => h(App),
    methods: {
        getStorage(name) {
            return JSON.parse(localStorage.getItem(name));
        },
        setStorage(name, data) {
            localStorage.setItem(name, JSON.stringify(data));
        },
        removeStorage(name) {
            localStorage.removeItem(name);
        },
        clear() {
            localStorage.clear();
        }
    }
}).$mount('#app')

export default _Vue;